package com.luych.toolbox.data.service.dao;

import com.luych.toolbox.data.service.entity.DataCompareHistoryColumn;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface DataCompareHistoryColumnDao extends JpaRepository<DataCompareHistoryColumn, String>, JpaSpecificationExecutor<DataCompareHistoryColumn> {

    void deleteByDataCompareHistoryId(String dataCompareHistoryId);

    void deleteByDataCompareHistoryIdIn(List<String> dataCompareHistoryIds);

    @Modifying
    @Query(value = "TRUNCATE data_compare_history_column", nativeQuery = true)
    void truncate();
}